// src/main/java/com/example/qqviewspringboot/service/MessageService.java

package com.example.qqviewspringboot.service;

import com.example.qqviewspringboot.data.Message;

import java.util.List;

public interface MessageService {

    Message saveAndNotifyMessage(Long senderId, Long recipientId, String content);

    List<Message> getConversation(Long userId, Long friendId);

    List<Message> getUnreadMessages(Long userId);

    void markMessagesAsRead(List<Long> messageIds);

    List<Message> getPendingMessages(Long recipientId);

    Message saveMessage(Long senderId, Long recipientId, String content);

    List<Object[]> getAllConversations(Long userId);
    /**
     * 保存消息并通知接收者（包括媒体）
     *
     * @param senderId    发送者ID
     * @param recipientId 接收者ID
     * @param content     消息内容
     * @param mediaType   媒体类型（如 "image/png", "video/mp4"）
     * @param mediaUrl    媒体文件的 URL
     * @return 保存的消息
     */
    Message saveAndNotifyMessage(Long senderId, Long recipientId, String content, String mediaType, String mediaUrl);
    void updateMessageStatus(Message message);
}
